package ar.edu.unq.wannaplay.panels.project;

import org.apache.wicket.markup.html.navigation.paging.PagingNavigator;

import ar.edu.unq.wannaplay.panels.WPListViewPanel;
import ar.edu.unq.wannaplay.roles.AbstractLinkAdderStrategy;
import ar.edu.unq.wannaplay.services.ProjectService;
import ar.edu.unq.wannaplay.utils.ProjectsListView;

public class ProjectsViewPanel extends WPListViewPanel<ProjectService> {

    private static final long serialVersionUID = 1L;

    public ProjectsViewPanel(final String id, final ProjectService service) {
        super(id, service, new String[] { "name", "interval", "client", "manHour" });
        this.initialize();
    }

    private void initialize() {
        AbstractLinkAdderStrategy.getUserLoged().addProjectsCreateLink(this);
        this.add(this.prepareHeaderLabel("headers"));
        ProjectsListView listView = new ProjectsListView("populatedList", this.getService(), this.getLabels(), this);
        this.add(listView);
        this.add(new PagingNavigator("navigator", listView));

    }
}